package com.xiaou.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xiaou.entity.Permission;
import com.xiaou.entity.Role;
import com.xiaou.mapper.PermissionMapper;

@Service
public class PermissionService {
	@Autowired
	private  PermissionMapper permissionMapper;
	public Role findRoleByUid(Integer uid) {
		
		Role role = permissionMapper.findRoleById(uid);
		List<Permission> permissionList = permissionMapper.findPermissionByRid(role.getId());
		role.setPermissionList(permissionList);
		return role;
		
	}
}
